package cn.lwy.example.niit_race.service;

import cn.lwy.example.niit_race.dao.MatterMapper;
import cn.lwy.example.niit_race.pojo.Matter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MatterServiceImpl implements MatterService{

    @Autowired
    MatterMapper matterMapper;

    @Override
    public List<Matter> getMatterByUserId(int id){
        return matterMapper.getMatterByUserId(id);
    }

    @Override
    public int getIdByUsername(String name) {
        return matterMapper.getIdByUsername(name);
    }

    @Override
    public int getRoleIdByUsername(String name) {
        return matterMapper.getRoleIdByUsername(name);
    }

    @Override
    public void addMatter(Matter matter) {
        matterMapper.addMatter(matter);
    }

    @Override
    public Matter getMatterById(int id) {
        return matterMapper.getMatterById(id);
    }

    @Override
    public void updateMatter(Matter matter) {
        matterMapper.updateMatter(matter);
    }

    @Override
    public void delMatter(int id) {
        matterMapper.delMatter(id);
    }
}
